GCC=g++
RMFLAGS=-f
PROGNAME=tom
TESTNAME=test.sh

.PHONY: clean bin dustclean

default: clean bin dustclean

all: clean bin

bin: main.o ToModelSequence.o ToSequence.o
	$(GCC) -o $(PROGNAME) main.o ToModelSequence.o ToSequence.o
	chmod u+x $(PROGNAME)
	mv $(PROGNAME) ../bin/$(PROGNAME)
	chmod u+x $(TESTNAME)
	cp $(TESTNAME) ../bin/$(TESTNAME)

ToSequence.o: ToSequence.cpp
	$(GCC) -c ToSequence.cpp

ToModelSequence.o: ToModelSequence.cpp
	$(GCC) -c ToModelSequence.cpp

main.o: main.cpp
	$(GCC) -c main.cpp

clean:
	rm $(RMFLAGS) $(PROGNAME)
	rm $(RMFLAGS) main.o
	rm $(RMFLAGS) ToModelSequence.o
	rm $(RMFLAGS) ToSequence.o

dustclean:
	rm $(RMFLAGS) *.o
	rm $(RMFLAGS) *~

